package sqlTestes.criarSqlDeUmaTabela;

import infra.Cenario;
import junit.framework.Assert;

import org.junit.Test;

import sql.ddl.Tabela;
import sql.ddl.coluna.types.Int4;

public class TabelaComUmaColuna extends Cenario {
	private Tabela tabela;

	public void dadoQue() {
		aTabelaTemNomeAgua();
	}

	public void quando() {
		aTabelaEstaComAColunaAguaInterira();
	}

	public void entao() {
		oSqlSeraGerado();
	}

	public void aTabelaTemNomeAgua() {
		tabela = new Tabela("Agua");
	}

	public void aTabelaEstaComAColunaAguaInterira() {
		tabela.addColuna(new Int4("agua", null));
	}

	@Test
	public void oSqlSeraGerado() {
		Assert.assertEquals("CREATE TABLE Agua(agua INT4)", tabela.codigoSQL());

	}
}